﻿using DAL;
using IService;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Service
{
    public class WhInboundService:IWhInboundService
    {
        private WhInboundDal _wda;
        public WhInboundService(WhInboundDal wda)
        {
            _wda = wda;
        }

        /// <summary>
        /// 添加入库单、入库明细和附件
        /// </summary>
        /// <param name="wifa"></param>
        /// <param name="widfaList"></param>
        /// <param name="sadList"></param>
        /// <returns></returns>
        public int AddWhInbound(WhInboundForAdd wifa, List<WhInboundDetailForAdd> widfaList, List<SysAttachmentDTO> sadList)
        {
            return _wda.AddWhInbound(wifa, widfaList, sadList);
        }

        /// <summary>
        /// 可批量审核/驳回入库单
        /// </summary>
        /// <param name="whOrderId"></param>
        /// <param name="orderStatu"></param>
        /// <param name="auditorId"></param>
        /// <param name="auditorComment"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public Task<int> AuditeWhInboundOrder(List<long> whOrderIdList, string orderStatu, long auditorId, string auditorComment)
        {
            return _wda.AuditeWhInboundOrder(whOrderIdList, orderStatu, auditorId, auditorComment);
        }

        /// <summary>
        /// 可批量撤销入库单
        /// </summary>
        /// <param name="orderIdList"></param>
        /// <param name="orderStatu"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public Task<int> ChangeWhInboundStatu(List<long> orderIdList, string orderStatu, long userId)
        {
            return _wda.ChangeWhInboundStatu(orderIdList, orderStatu, userId);
        }

        /// <summary>
        /// 批量删除入库单
        /// </summary>
        /// <param name="orderIdList"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public Task<int> DeleteWhInbound(List<long> orderIdList, long userId)
        {
            return _wda.DeleteWhInbound(orderIdList, userId);
        }

        /// <summary>
        /// 查询全部入库单信息
        /// </summary>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public Task<List<WhInbound>> GetAllInboundInfo()
        {
            return _wda.GetAllInboundInfo();
        }

        /// <summary>
        /// 多条件查询关联进货单号详细信息
        /// </summary>
        /// <param name="wisws"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public Task<List<OmPurchaseOrderSourceDetail>> GetOmPurchaseOrderSourceWithSth(WhInSelectWithSth wisws)
        {
            return _wda.GetOmPurchaseOrderSourceWithSth(wisws);
        }

        /// <summary>
        /// 根据进货单号查询进货单商品详情
        /// </summary>
        /// <param name="upOrderId"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public Task<List<OmPurOrderGoodsDetail>> GetOmPurOrderGoodsDetail(long upOrderId)
        {
            return _wda.GetOmPurOrderGoodsDetail(upOrderId);
        }

        /// <summary>
        /// 多条件查询入库单
        /// </summary>
        /// <param name="wisws"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public Task<List<WhInbound>> GetSomeInboundInfo(WhInbSelectWithSth wisws)
        {
            return _wda.GetSomeInboundInfo(wisws);
        }

        /// <summary>
        /// 查询仓库信息用于下拉框
        /// </summary>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public Task<List<WareHouseDTO>> GetWareHouseInfoForSelect()
        {
            return _wda.GetWareHouseInfoForSelect();
        }

        /// <summary>
        /// 关联进货单号
        /// </summary>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public Task<List<OmPurchaseOrderSourceDetail>> OmPurchaseOrderSourceDetailsForSelect()
        {
            return _wda.OmPurchaseOrderSourceDetailsForSelect();
        }

        /// <summary>
        /// 根据仓库ID查询可用库位信息用于入库单
        /// </summary>
        /// <param name="warehouseId"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public Task<List<WhLocationSelect>> SelectWhLocationForInbound(long warehouseId)
        {
            return _wda.SelectWhLocationForInbound(warehouseId);
        }
    }
}
